package com.itasura.bridge;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author sailor wang
 * @date 2018/9/11 下午2:09
 * @description
 */
public class Sword implements Weapon{

    private static final Logger LOGGER = LoggerFactory.getLogger(Sword.class);

    private final Enchantment enchantment;

    public Sword(Enchantment enchantment){
        this.enchantment = enchantment;
    }

    @Override
    public Enchantment getEnchantment() {
        return this.enchantment;
    }

    @Override
    public void wield() {
        LOGGER.info("仓啷啷拔出宝剑....");
        enchantment.onActivate();
    }

    @Override
    public void swing() {
        LOGGER.info("仓啷啷拔出宝剑，天下第一剑....");
        enchantment.apply();
    }

    @Override
    public void unwield() {
        LOGGER.info("仓啷啷? 我把 ！ 我再把 ！....");
        enchantment.onDeactivate();
    }
}